Extended HTTP support. Again.
This extension is hosted at PECL and can be installed with PEAR's pecl command:
# pecl install pecl_http
pecl/http depends on a number of system libraries and PHP extensions for special features.
The following system libraries are required to build this extension:
--with-http-zlib-dir
apt-get install zlib1g-dev
The following system libraries are optional and provide additional features:
--with-http-libcurl-dir
apt-get install libcurl4-openssl-dev
--with-http-libbrotli-dir
apt-get install libbrotli-dev
--with-http-libevent-dir
apt-get install libevent-dev
--with-http-libicu-dir
apt-get install libicu-dev
--with-http-libidn-dir
apt-get install libidn11-dev
--with-http-libidn2-dir
apt-get install libidn2-0-dev
--with-http-libidnkit-dir
--with-http-libidnkit2-dir
If configured with multiple IDNA libraries' support, there's a run-time precedence of ICU over GNU libidn, which in turn has precendence over idnkit. If neither IDNA2008, nor IDNA2003 is explicitly requested, IDNA2008 has precendence.
There are usually different styles of SSL support for libcurl available, so you can choose between 'openssl' and f.e. 'nss' or 'gnutls' when installing libcurl.
This extension unconditionally depends on the pre-loaded presence of the following PHP extensions:
If configured --with-http-shared-deps
(default) it depends on the pre-loaded presence of the following extensions, as long
as they were available at build time:
Please ensure that all extension on which pecl/http depends, are loaded before it, e.g in your php.ini
:
; obligatory deps
extension = raphf.so
extension = propro.so (PHP < 8.0, ext-http < 3.0 only)
; if shared deps were enabled
extension = hash.so
extension = iconv.so
extension = json.so
; finally load pecl/http
extension = http.so
The http extension registers the http.*
namespace for its stream filters. Provided stream filters are:
This extension provides a stub file four your editor's auto-completion.
Download the Stub file:
The HTTP client. See http\Client\Curl's options which is the only driver currently supported.
class http\Client implements SplSubject
, Countable
A class representing a list of cookies with specific attributes.
class http\Cookie
namespace http\Encoding
The http\Env class provides static methods to manipulate and inspect the server's current request's HTTP environment.
class http\Env
The http extension's Exception
interface.
interface http\Exception
The http\Header class provides methods to manipulate, match, negotiate and serialize HTTP headers.
class http\Header implements Serializable
The message class builds the foundation for any request and response message.
class http\Message implements Countable
, Serializable
, Iterator
Parse, interpret and compose HTTP (header) parameters.
class http\Params implements ArrayAccess
The http\QueryString class provides versatile facilities to retrieve, use and manipulate query strings and form data.
class http\QueryString implements Serializable
, ArrayAccess
, IteratorAggregate
The http\Url class provides versatile means to parse, construct and manipulate URLs.
class http\Url